Skip to content

fix(worker): retry the GitLab repository catalog step on transient timeouts - #302

Merged
outof-place merged 1 commit into
mainfrom
fix/gitlab-catalog-retry
Aug 18, 2026
Merged

fix(worker): retry the GitLab repository catalog step on transient timeouts#302
outof-place merged 1 commit into
mainfrom
fix/gitlab-catalog-retry

Conversation

@outof-place

Copy link
Copy Markdown
Collaborator

Problem

A single upstream GitLab hiccup fails a whole run. Observed failure:

Task UP-4859 failed: The block could not be completed.
(Step "step//./src/workflows/agent//listFreshRepositoryCatalogStep" failed after 0 retries:
 GitLab projects list timed out after 15000ms)

listFreshRepositoryCatalogStep (agent.ts) has maxRetries = 0 at the WDK level, so once its internal listing gives up, the run dies and a human has to re-move the ticket back into the AI column. The internal listing already retried (2 attempts, fixed 500ms backoff, 15s per-page timeout), but two consecutive 15s timeouts still exhausted it.

Change

All GitLab/GitHub listing goes through listRepositoriesWithRetry in apps/worker/src/adapters/vcs/repository-directory.ts. Hardened there, surgically:

  • Attempts: 2 -> 3 (LISTING_MAX_ATTEMPTS) - one more chance to ride out a transient blip. Still bounded, no infinite retry.
  • Fixed 500ms backoff -> jittered exponential backoff (listingRetryDelayMs): full jitter over [0, 500ms] then [0, 1000ms], capped at 4s, so correlated upstream blips don't all retry in lockstep.
  • Per-page timeout: 15s -> 18s (GITLAB_PROJECTS_TIMEOUT_MS) - the failure showed GitLab responding slower than 15s, so a modest raise survives genuine slowness.

Worst case is 3 * 18s + <=1.5s backoff ~= 55.5s, which stays inside the ~60s pre-sandbox listing budget the surrounding comments reason about (also honored by the dashboard catalog endpoint that shares this path). The listing is already paginated (per_page=100, follows x-next-page), so unbounded fetching was not the cause.

Permanent failures still surface unchanged: after the attempts are exhausted the original error (with its clear "GitLab projects list timed out after 18000ms" / status reason) is rethrown, not swallowed.

Tests

apps/worker/src/adapters/vcs/repository-directory.test.ts:

  • transient GitLab timeout twice then success on the third, bounded attempt -> resolves with the recovered listing (3 fetches)
  • a timeout that never clears -> fails after exactly 3 attempts with the timeout reason (bounded, no infinite retry)

Touched-file run: 19 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_015kfeohXE66xx7RJPxZ2pvH

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ai-workflow-app-dashboard Ready Ready Preview Aug 18, 2026 8:56am

Request Review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5bfc42a4-c509-48d4-94df-506dbc3a2092


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@outof-place
outof-place merged commit bc89bf9 into main Aug 18, 2026
7 checks passed
@outof-place
outof-place deleted the fix/gitlab-catalog-retry branch August 18, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant